<?php
namespace app\console\controller;
use app\model\Demo as SelfModel;
use app\model\DemoRadio;
use app\model\DemoSelect;
use app\model\DemoSelectmany;
use app\model\Checkbox;

use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Request;
use think\facade\Route;
use think\facade\View;
use think\facade\Db;
use think\facade\Cache;
use think\facade\Cookie;
class Demo extends Base
{



    public function initialize()
    {
        parent::initialize();
        $this->model = "\app\model\Demo";
        $this->list_rows = 20;
        $this->order = ['sort'=>'asc','id'=>'desc'];
    }
    public function select()
    {
            $demo_radio = DemoRadio::order([ 'id' => 'desc'])->select()->toArray();
            View::assign('demo_radio', $demo_radio);
            $demo_select = DemoSelect::where([['status', '=', 1]])->order(['sort' => 'asc', 'id' => 'desc'])->select()->toArray();
            View::assign('demo_select', $demo_select);
            $demo_selectmany = DemoSelectmany::where([['status', '=', 1]])->order(['sort' => 'asc', 'id' => 'desc'])->select()->toArray();
            View::assign('demo_selectmany', $demo_selectmany);
            $checkbox = Checkbox::where([['status', '=', 1]])->order(['sort' => 'asc', 'id' => 'desc'])->select()->toArray();
            View::assign('checkbox', $checkbox);

    }






}